<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Admin/js/ajaxfileupload.js"></script>
<style type="text/css">
  .w240{width: 240px;}
  .sml-240{padding-left: 240px;}
</style>


<div id="content" class="">
        <div class="row">
          <div class="col-md-12">
            <!-- Input Fields -->
            <div class="panel">
              <div class="panel-heading">
                <span class="panel-title">前端banner设置</span>
              </div>
              <div class="admin-form theme-primary  center-block" style="padding-bottom: 175px; margin-top:30px; width:90%;">
              <div class="panel heading-border panel-primary">
                <form method="post" action="{:U('System/doBannerPc')}"  >
                  <div class="panel-body bg-light">
                    <div class="section-divider mt20 mb40"><span> Banner信息项 </span></div>
                    <!-- .section-divider -->
                  <?php
                  $num = 1;

					//$e = new Exception;
					//var_dump($e->getTraceAsString());

                   foreach($banner['old'] as $k => $v){
                    $v['name'] = 'banner-'.$num;

                    $num++;
                  ?>
                    <div class="section col-md-12">

                    <div>{$v['name']}</div>
                    <div class="col-md-6">

                       <span class="fileupload-preview thumbnail m5 " >
                            <img src="{$v['images']}" class="img-responsive" id="{$v['imgid']}" title="{$v['images']}">
                      </span>

                      <input type="file" class="gui-file" style="width:0px" name="{$v['filename']}" id="{$v['filename']}" onchange=" ajaxuploadImg('{$v['filename']}','{$v['inputname']}','{:U('Ajax/uploadImg')}','{$v['imgid']}');">
                      <input type="hidden" id="{$v['inputname']}" name="images[]" value="{$v['images']}">
                      <input type="hidden" name="bid[]" value="{$v['id']}">
                    </div>

                    <div class="section col-md-6">
                    <!--  <div class="smart-widget sm-left sml-120">
                        <label class="field prepend-icon ">
                          <input type="text" name="url[]"  class="gui-input" placeholder="图片跳转地址" value="{$v['url']}">
                        </label>
                        <label  class="button btn-primary w240" >目标地址：</label>
                      </div>
                      <br>-->
                      <!--
                      <div class="smart-widget sm-left sml-120">
                        <label class="field prepend-icon ">
                          <input type="text" name="alt[]"  class="gui-input" placeholder="图片描述" value="{$v['alt']}">
                        </label>
                        <label  class="button btn-primary w240" >图片描述：</label>
                      </div>
                       -->
                      <br>
                      <div class="smart-widget sm-left sml-120">
                        <label class="field prepend-icon ">
                          <input type="text" name="sort[]"  class="gui-input" placeholder="排序" value="{$v['sort']}">
                        </label>
                        <label  class="button btn-primary w240" >排序：</label>
                      </div>
                    </div>
                      <span class="fileupload-preview  m5 pull-right"><button type="button" onclick="getinputclick('{$v['filename']}');" class="btn active btn-primary btn-block">上传图片</button></span>
                    </div>
                  <?php } ?>

                  <?php
                   foreach($banner['new'] as $k => $v){
                    $v['name'] = 'banner-'.$num;
                    $num++;
                  ?>
                    <div class="section col-md-12">

                    <div>{$v['name']}</div>
                    <div class="col-md-6">

                       <span class="fileupload-preview thumbnail m5 " >
                            <img src="{$v['images']}" class="img-responsive" id="{$v['imgid']}" title="stairs-to_soul.jpg">
                      </span>
                      <input type="file" class="gui-file" style="width:0px" name="{$v['filename']}" id="{$v['filename']}" onchange=" ajaxuploadImg('{$v['filename']}','{$v['inputname']}','{:U('Ajax/uploadImg')}','{$v['imgid']}');">
                      <input type="hidden" id="{$v['inputname']}" name="images[]" value="{$v['images']}">
                      <input type="hidden" name="bid[]" value="{$v['id']}">
                    </div>

                    <div class="section col-md-6">
                     <!--
                      <div class="smart-widget sm-left sml-120">
                        <label class="field prepend-icon ">
                          <input type="text" name="alt[]" id="webname" class="gui-input" placeholder="图片描述" value="{$v['alt']}">
                        </label>
                        <label  class="button btn-primary w240" >图片描述：</label>
                      </div>
					 -->
                      <br>
                      <div class="smart-widget sm-left sml-120">
                        <label class="field prepend-icon ">
                          <input type="text" name="sort[]" id="webname" class="gui-input" placeholder="排序" value="{$v['sort']}">
                        </label>
                        <label  class="button btn-primary w240" >排序：</label>
                      </div>
                    </div>

                      <span class="fileupload-preview  m5 pull-right"><button type="button" onclick="getinputclick('{$v['filename']}');" class="btn active btn-primary btn-block">上传图片</button></span>
                    </div>
                  <?php } ?>

                </div>
                  <div class="panel-footer text-right">
                    <button type="submit" class="button btn-primary">提交</button>
                    <button type="reset" class="button btn-primary">清空</button>
                  </div>
                  <!-- end .form-footer section -->
                </form>

              </div>

            </div>
            </div>
          </div>
        </div>
</div>
<script type="text/javascript">
  function getinputclick(id){
      var dom = $("#"+id);
      dom.click();
  }

</script>
